<?php
header('Content-Type: text/html; charset=utf-8');
function filter_0_char($data) {
    $str = json_encode($data,true);//转换为Unicode编码

    $patterns     = []; //正则表达式
    $replacements = []; //替换成的字符
    //公共
    $patterns[0] = '/®/';
    $replacements[0] = '';

    //零宽字符&#8203;
    $patterns[1] = '/&#8203;/';
    $replacements[1] = '';

    //零宽字符&#8203;
    $patterns[2] = '#\\\u200b#us';
    $replacements[2] = '';
    $str = preg_replace($patterns, $replacements, $str);

    $str = json_decode($str);//解码Unicode编码

    return $str;
}

$str = "mo leng xi";
var_dump($str);
$cleanedText = preg_replace('/\p{Z}/u', ' ', $str);

var_dump($cleanedText);

